package cn.wolfcode.enums;

import lombok.Getter;

/**
 * 预约单枚举类
 */
@Getter
public enum NoticeLevelEnum {
    URGENT("紧急",0),
    IMPORTANT("重要",1),
    NORMAL("普通",2);

    private String name;
    private Integer value;
    NoticeLevelEnum(String name, Integer value){
        this.name = name;
        this.value = value;
    }
    //传入value来找到name
    public static String findName(Integer value){
        NoticeLevelEnum[] enums = NoticeLevelEnum.values();
        for (NoticeLevelEnum anEnum : enums) {
            if (anEnum.getValue().equals(value)) {
                return anEnum.getName();
            }
        }
        return null;
    }
}
